<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: 自由如风
  Date: 2018/6/9
  Time: 14:35
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<style>
    table {
        border-collapse: collapse;
    }

    td {
        border: 1px solid #000;
        padding: 10px;
    }
</style>
<body>
<a href="${pageContext.request.contextPath}/admin/adminCenter.jsp">返回管理中心</a><br/>
用户列表<br/>
        <table>
            <tr>
                <th>id</th>
                <th>用户名</th>
                <th>密码</th>
                <th>状态</th>
                <th>操作</th>
                <th>删除</th>
            </tr>

        <c:forEach items="${userList}" var="user">
            <tr>
            <td>
                ${user.userId}
            </td>
            <td>
                ${user.userName}
            </td>
            <td>
                ${user.password}
            </td>
            <td>
            <c:if test="${user.status==1}">
                冻结
                <td><a href="${pageContext.request.contextPath}/admin/updateStatus?userId=${user.userId}&status=${user.status}">解冻</a></td>
            </c:if>
            <c:if test="${user.status==0}">
                正常
                <td><a href="${pageContext.request.contextPath}/admin/updateStatus?userId=${user.userId}&status=${user.status}">冻结</a></td>
            </c:if>
                <td>
                    <a href="${pageContext.request.contextPath}/deleteuser?userId=${user.userId}">删除</a>
                </td>
            <td/>

            <tr/>
        </c:forEach>
        </table>

</body>
<head>
    <title>Title</title>
</head>
</html>
